Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul extension bundling #844

Merged
merged 5 commits into from
Dec 30, 2023
Merged

Overhaul extension bundling #844

merged 5 commits into from
Dec 30, 2023

Conversation

JohnnyMorganz
Copy link
Owner

@JohnnyMorganz JohnnyMorganz commented Dec 30, 2023

Supersedes #767

This approach follows a similar approach to Biome, where we still rely on downloading bundled versions, but with a better interface.

By default, we look for a StyLua binary on the PATH (Closes #527). This can be disabled with stylua.searchBinaryOnPATH.

The stylua binary lookup works in the following order:

  1. Use stylua.styluaPath if specified
  2. Lookup in the PATH environment variable for a binary if stylua.useBinaryFromPATH is enabled (default: true)
  3. Fall back to a bundled version of stylua

StyLua is commonly managed by other tools such as Aftman/Foreman, or a system installation. Step (2) means that we will use the same version that a user has on the command line to run stylua. This means the version will always remain in sync

If there is no StyLua binary available, we use a bundled extension like before, with a few updates:

  • Display a "bundled" status in the status bar
  • Improve prompt on new updates. It is now a status bar button notifying of an update. This info can also be hidden.
  • Better support stylua.targetReleaseVersion:

Also, if the stylua binary found on the PATH fails to execute (e.g., aftman managed but not in aftman.toml), we gracefully fall back to the bundled version

Copy link

codecov bot commented Dec 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2cf5e80) 97.03% compared to head (0a4fa5f) 97.03%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #844   +/-   ##
=======================================
  Coverage   97.03%   97.03%           
=======================================
  Files          16       16           
  Lines        5995     5995           
=======================================
  Hits         5817     5817           
  Misses        178      178           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JohnnyMorganz JohnnyMorganz marked this pull request as ready for review December 30, 2023 16:12
@JohnnyMorganz JohnnyMorganz merged commit 863c0cc into main Dec 30, 2023
19 checks passed
@JohnnyMorganz JohnnyMorganz deleted the extension-bundling-v2 branch December 30, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant